package ph.com.gs3.chat.model.tables;

public class UserAccountTable extends AbstractDataTable {

	public static final String TAG = UserAccountTable.class.getSimpleName();

	// table name
	public static final String NAME = "User_Account";

	// table columns
	public static final String COL_ID = "_id";
	public static final String COL_WEB_ID = "web_id";
	public static final String COL_COMPANY_ID = "company_id";
	public static final String COL_COMPANY_NAME = "company_name";
	public static final String COL_EMAIL = "email";
	public static final String COL_PASSWORD = "password";
	public static final String COL_SERVER = "server";
	public static final String COL_DISPLAY_NAME = "display_name";
	public static final String COL_IMAGE_URL = "image_URL";
	public static final String COL_USER_LEVEL_ID = "user_level_id";

	public static final String COL_LAST_ALL_FORMS_UPDATE = "last_all_forms_update";
	public static final String COL_LAST_ALL_DOCUMENTS_UPDATE = "last_all_documents_update";
	public static final String COL_LAST_ALL_COMMENTS_UPDATE = "last_all_comments_update";

	public static final String COL_IS_ACTIVE = "is_active";

	@Override
	public String[] getTableColumns() {

		return new String[] { COL_ID, COL_WEB_ID, COL_COMPANY_ID, COL_COMPANY_NAME, COL_EMAIL,
		        COL_PASSWORD, COL_SERVER, COL_DISPLAY_NAME, COL_IMAGE_URL, COL_USER_LEVEL_ID,
		        COL_LAST_ALL_FORMS_UPDATE, COL_LAST_ALL_DOCUMENTS_UPDATE,
		        COL_LAST_ALL_COMMENTS_UPDATE, COL_IS_ACTIVE

		};
	}

	@Override
	protected String getCreateTableQuery() {

		// @formatter:off
		return "CREATE TABLE " + NAME + "("
				+ COL_ID 			+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
				+ COL_WEB_ID 		+ " TEXT NOT NULL, "
				+ COL_COMPANY_ID 	+ " TEXT NOT NULL, "
				+ COL_COMPANY_NAME 	+ " TEXT, "
				+ COL_EMAIL 		+ " TEXT NOT NULL, "
				+ COL_PASSWORD 		+ " TEXT, "
				+ COL_SERVER 		+ " TEXT NOT NULL, "
				+ COL_DISPLAY_NAME 	+ " TEXT NOT NULL, "
				+ COL_IMAGE_URL 	+ " TEXT, "
				+ COL_USER_LEVEL_ID + " TEXT NOT NULL,"				
				
				+ COL_LAST_ALL_FORMS_UPDATE 	+ " TEXT, "
				+ COL_LAST_ALL_DOCUMENTS_UPDATE + " TEXT, "
				+ COL_LAST_ALL_COMMENTS_UPDATE 	+ " TEXT, "
				
				+ COL_IS_ACTIVE		+ " BOOLEAN NOT NULL"
				+ "); ";
		// @formatter:on
	}

	@Override
	protected String getTableName() {
		return NAME;
	}

}
